package com.googlecode.maurersmarbles.drawables;

import com.googlecode.maurersmarbles.Card;

import android.graphics.Canvas;
import android.graphics.Point;

public abstract class CardDrawable implements Drawable {

	/**
	 * Whether or not the card is selected.
	 */
	private boolean selected;
	/**
	 * The card to draw.
	 */
	private Card card;
	/**
	 * The corners of the card on the screen.
	 */
	private Point[] corners;

	/**
	 * Creates a new CardDrawable.
	 * @param card the card to draw
	 * @param corners the corners of the card on the screen
	 */
	public CardDrawable(Card card, Point[] corners) {
		this(card, corners, false);
	}

	/**
	 * Creates a new CardDrawable.
	 * @param card the card to draw
	 * @param corners the corners of the card on the screen
	 * @param selected whether or not the card is selected
	 */
	public CardDrawable(Card card, Point[] corners, boolean selected) {
		this.card = card;
		this.corners = corners;
		this.selected = selected;
	}

	@Override
	public void draw(Canvas canvas) {
		drawCard(canvas, card, corners, selected);
	}

	/**
	 * Draws the given card using the given corner points.
	 * @param canvas the canvas to draw the card in
	 * @param card the card to draw
	 * @param corners the corners of the card on the screen
	 * @param selected whether or not the card is selected
	 */
	public abstract void drawCard(Canvas canvas, Card card, Point[] corners,
			boolean selected);

}
